home *** CD-ROM | disk | FTP | other *** search
- /* *********************************************** */
- /* lvtest.rexx */
- /* Author: Bob Dickow (dickow@uidaho.edu) */
- /* $VER: lvtest.rexx V1.0 (09.04.98) */
- /* *********************************************** */
-
- /* ************************************************************ */
- /* Simple arexx script to test and demo rxlistreq host. */
- /* The host will display a gadtools listview in a window */
- /* and displays a list specified by the calling arexx script. */
- /* */
- /* After the user clicks on an item or cancels the requester, */
- /* the host will return control to the calling arexx program. */
- /* ************************************************************ */
-
- /* *********************************************************************** */
- /* USAGE: Start up the rxlistreq host through a shell command, then */
- /* address the host as ADDRESS "RXLISTREQ" (or if you want to specify */
- /* a host name, add it after the shell callup of rxlistreq as a cli */
- /* parameter: run rxlistreq LISTVIEW) */
- /* Then 'send' the command, after using ADDRESS "<PORTNAME>" as: */
- /* rxlistreq <NUMBER_IN_LIST> <LIST_STEM_NAME> [WINDOW_PARMS_STEMNAME] */
- /* */
- /* The last parameter is optional, and will default to "RXLV" */
- /* Parameters: */
- /* <NUMBER_IN_LIST>: This number tells the host to show a list with the */
- /* specified number of elements. The AREXX calling script or program */
- /* must declare a list as a stem variable indexed from 0, as in: */
- /* STEM.0 = "Hello" ; STEM.1 = "GOODBYE" ; STEM.2 = "342" .... */
- /* The host will use the stem name in the parameter, with no default */
- /* to fall back to. */
- /* <LIST_STEM_NAME>: The AREXX stem variable name for the list of items. */
- /* This list should be indexed from 0, and may continue to any ex- */
- /* tent. The indexes should be successive integer numbers (1, 2 etc) */
- /* <WINDOW_PARMS_STEMNAME>: This is an optional stem variable name that */
- /* the script can use to pass various parameters for the listview */
- /* window display. The default stem is "RXLV". The choices are: */
- /* */
- /* RXLV.LVLABEL -- A String to place above the listview */
- /* RXLV.BUTTONLABEL -- A String to place inside the CANCEL button */
- /* RXLV.XPOS -- The screen X position to open the window */
- /* RXLV.YPOS -- The screen Y position to open the window */
- /* (if not specified, opens near the mouse pointer) */
- /* RXLV.WIDTH -- The desired width of the window */
- /* RXLV.HEIGHT -- The desired height of the window */
- /* (Will not be smaller than 150 x 200 pixels) */
- /* RXLV.SCREEN -- Name of the public screen on which to display */
- /* the window. Default is the Workbench. */
- /* *********************************************************************** */
-
- /* ***************************************************************************** */
- /* The rxlistreq host program returns the following variables, which will */
- /* be created in the symbol table if not already declared: */
- /* [RXLV].CLICKED = number of the item chosen, unset if user cancels or quits. */
- /* [RXLV].EXIT = key (or the close gadget) that the user used to exit, if */
- /* the user decides to abort the window and not make a choice from the */
- /* list. Currently the user may abort by clicking the close gadget or */
- /* the CANCEL button gadget, or by typing the ESC key or the HELP key. */
- /* EXITCHOICE will be set to strings "CANCEL, CLOSE, ESC, or HELP" */
- /* respectively, or to LIST if the listview is clicked. */
- /* ***************************************************************************** */
-
- ADDRESS COMMAND
-
- options results
-
- 'run rxlistreq' /* add an addition cli parameter to specify your own address choice */
-
- 'waitforport RXLISTREQ' /* the default address */
-
- ADDRESS "RXLISTREQ"
-
- /* set up your array for the listview */
-
- Listus.0 = "Choice #1 (index 0)"
- Listus.1 = "Choice #2 (index 1)"
- Listus.2 = "Choice #3 (index 2)"
-
- RXLV.LVLABEL = "Click Your Choice" /* "Click to Select" by default */
- RXLV.BUTTONLABEL = "I'm Done" /* "Cancel" by default */
- RXLV.XPOS = -1 /* Set to open at x position, or -1 for mouse pos */
- RXLV.YPOS = -1 /* Set to open at y position, or -1 for mouse pos */
- RXLV.WIDTH = 175 /* default = 150 */
- RXLV.HEIGHT = 240 /* default = 200 */
- RXLV.SCREEN = "WorkBench" /* The default pubscreen anyway */
- /* RXLV.SCREEN = "FinalWriterPubScreen" */ /* ...for example */
-
- rxlistreq 3 LISTUS RXLV /* the command that rxlistreq will parse */
-
- ADDRESS
-
- say "The Host returned" RC "in RC"
-
- If RXLV.EXIT == "LIST" then DO
- CLICKED = RXLV.CLICKED /* N.B.No variable substitution, sorry */
- say "Item Clicked=" CLICKED "VALUE=" LISTUS.CLICKED
- END
- ELSE /* the user decide not to click on a listview item */
- IF RC = 0 then say "The user hit" RXLV.EXIT
- exit
-
-